Skip to content

DataGrid - AI Assistant: Support Store Push API#33584

Merged
Alyar666 merged 2 commits into
DevExpress:26_1from
Alyar666:datagrid_ai_assistant_support_store_push_api_26_1
May 14, 2026
Merged

DataGrid - AI Assistant: Support Store Push API#33584
Alyar666 merged 2 commits into
DevExpress:26_1from
Alyar666:datagrid_ai_assistant_support_store_push_api_26_1

Conversation

@Alyar666
Copy link
Copy Markdown
Contributor

No description provided.

@Alyar666 Alyar666 self-assigned this May 14, 2026
Copilot AI review requested due to automatic review settings May 14, 2026 18:35
@Alyar666 Alyar666 requested a review from a team as a code owner May 14, 2026 18:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the DataGrid AI Assistant integration to better support the Store Push API by reacting to message store push events and routing user-inserted messages into the AI request pipeline.

Changes:

  • Added AIChat.getUserId() so the assistant can detect which pushed messages belong to the current user.
  • Switched the assistant view to bind dxChat to an ArrayStore and subscribe to store push events to trigger requests for inserted user messages.
  • Refactored the controller API from “get message dataSource” to “get message store”, and updated unit tests accordingly.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.ts Exposes chat user id via a new getUserId() helper.
packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.test.ts Adds coverage for getUserId() behavior (initialized/uninitialized cases).
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/utils.ts Adds isUserMessage helper for author-id matching.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts Subscribes to store push events and triggers AI requests on inserted user messages; binds chat dataSource to the store.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_controller.ts Replaces getMessageDataSource() with getMessageStore().
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/utils.test.ts Adds unit tests for isUserMessage.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/ai_assistant_view.test.ts Updates view tests for store-based dataSource and adds push-handler tests.
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/ai_assistant_controller.test.ts Updates controller tests to validate getMessageStore().
Comments suppressed due to low confidence (1)

packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts:119

  • subscribeMessageStorePush attaches a long-lived store.on('push', ...) listener but there is no corresponding unsubscription on view disposal. This can keep the view instance reachable and/or invoke handleMessageStorePush after the view is disposed. Add a dispose() (or equivalent lifecycle hook) to call messageStore.off('push', this.handleMessageStorePushContext).
  private subscribeMessageStorePush(messageStore: ArrayStore<Message, string>): void {
    messageStore.off('push', this.handleMessageStorePushContext);
    messageStore.on('push', this.handleMessageStorePushContext);
  }

@Alyar666 Alyar666 merged commit 2d07d7a into DevExpress:26_1 May 14, 2026
120 of 122 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants